unit console;
interface
uses
  SysUtils,
  SoundManager,
  Microsoft.DirectX.DirectSound;


procedure shell(Music : SoundM);

implementation
procedure shell(Music : SoundM);

var
  Name : String;
  i, ID : integer;

begin
  readln(Name);

  if Name = 'charger' then
    begin
      readln(Name);
      Music.AddSound(Name);
      Writeln ('Votre son a l''ID: ', Music.Collection.Counter-1);
    end;

  if Name = 'jouer' then
    begin
      Write ('Quel est l''ID du son?: ');
      Readln(ID);
      if ID>=Music.Collection.Counter then
        begin
          writeln('ID incorrect');
        end
      else
      begin
      Music.Play(ID);
      end;
    end;

  if Name = 'stop' then
    begin
      Write ('Quel est l''ID du son?: ');
      Readln(ID);
      if ID>=Music.Collection.Counter then
        begin
          writeln('ID incorrect');
        end
      else
      begin
      Music.Stop(ID);
      end;
    end;

  if Name = 'volume' then
    begin
      Write ('Quel est l''ID du son?: ');
      Readln(ID);
      if ID>=Music.Collection.Counter then
        begin
          writeln('ID incorrect');
        end
      else
      begin
      writeln('entre -10000 et 0');
      readln(i);
      Music.volume(i,ID);
      end;
    end;

  if Name = 'balance' then
    begin
      Write ('Quel est l''ID du son?: ');
      Readln(ID);
      if ID>=Music.Collection.Counter then
        begin
          writeln('ID incorrect');
        end
      else
      begin
      writeln('-1000:gauche ; 0:centre ; 1000:doite');
      readln(i);
      Music.balance(i,ID);
      end;
    end;
shell(Music);
end;


end.
